﻿@page "/radios"

<Block Title="Radio 单选框" Introduction="提供基本的选择框组件" CodeFile="radio.1.txt">
    <div class="form-inline">
        <div class="row">
            <div class="form-group col-4">
                <label class="control-label">选中</label>
                <Radio TItem="string" State="CheckboxState.Checked" OnStateChanged="@OnStateChanged"></Radio>
            </div>
            <div class="form-group col-4">
                <label class="control-label">未选</label>
                <Radio TItem="string" State="CheckboxState.UnChecked" OnStateChanged="@OnStateChanged"></Radio>
            </div>
        </div>
    </div>
    <Logger @ref="Trace" class="mt-3" />
</Block>


<Block Title="禁用单选框" Introduction="单选框不可用状态" CodeFile="radio.2.txt">
    <div class="form-inline">
        <div class="row">
            <div class="form-group col-4">
                <label class="control-label">选中</label>
                <Radio TItem="string" State="CheckboxState.Checked" IsDisabled="true"></Radio>
            </div>
            <div class="form-group col-4">
                <label class="control-label">未选</label>
                <Radio TItem="string" State="CheckboxState.UnChecked" IsDisabled="true"></Radio>
            </div>
        </div>
    </div>
</Block>

<Block Title="Label 文字" Introduction="单选框显示文字" CodeFile="radio.3.txt">
    <div class="form-inline">
        <div class="row">
            <div class="form-group col-12">
                <Radio TItem="string" DisplayText="显示文字"></Radio>
            </div>
        </div>
    </div>
</Block>

<Block Title="双向绑定数据" Introduction="绑定组件内变量，数据自动同步，绑定数据类型为 SelectedItem 类型数组" CodeFile="radio.4.txt">
    <div class="form-inline">
        <div class="row">
            <div class="form-group col-12">
                <Radio Items="@Items" OnStateChanged="@OnItemChanged"></Radio>
            </div>
        </div>
    </div>
    <Logger @ref="BinderLog" class="mt-3" />
</Block>

<AttributeTable Items="@GetAttributes()" />

<EventTable Items="@GetEvents()" />